#ifndef __Dict_H__
#define __Dict_H__

#include <string>



class Dict 
{
public:
	Dict();

	virtual ~Dict();

	inline bool isWord() const
	{
		return mIsWord; 
	}

	void addWord(const char* wd);

	int loadFile(const char* filename);

	bool isWord(const char* wd) const;

	unsigned int size() const;

	std::string getWord();

private:
	enum
	{
		kNumLetters = 26
	};

	inline int idx(char x) const
	{ 
		return x - 'A';
	}

	inline bool isAlphabet(char x) const
	{ 
		return x >= 'A' && x <= 'Z';
	}

	inline Dict* getChild(int i) const 
	{
		return mChildren[i]; 
	}

	bool isBoggleWord(const std::string& wd);

	Dict* mChildren[kNumLetters];

	Dict* mParent;

	bool mIsWord;

	char mLetter;
};

#endif //__Dict_H__